package cn.net.xyan.easy.spring.jpa;

import cn.net.xyan.easy.spring.core.config.AbstractAutoConfig;
import cn.net.xyan.easy.spring.core.config.IAutoConfigManager;
import cn.net.xyan.easy.spring.jdbc.EasyJDBC;
import cn.net.xyan.easy.spring.jpa.config.JPAConfiguration;
import org.springframework.core.annotation.Order;

import static cn.net.xyan.easy.spring.core.config.AbstractAutoConfig.ApplicationContextEnum.*;

/**
 * Created by xiashenpin on 16/1/16.
 */
@Order(value = EasyJPA.ORDER)
public class EasyJPA extends AbstractAutoConfig {
    static final int ORDER = EasyJDBC.RootOrder+10;

    @Override
    protected void configManager() {
        registerApplicationConfigClass(ROOT,JPAConfiguration.class);
        //registerApplicationConfigClass(MVC, MVCConfiguration.class);
        setupKey(IAutoConfigManager.EntityManagerInViewFilterParamKey).putValue("entityManagerFactory");
        registerRepositoryPackage(packageName("dao"));
        registerEntityPackage(packageName("entity"));
    }

    @Override
    protected void afterConfigManager() {

    }

}
